package org.example.config.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalException {

    @ExceptionHandler(RegisterException.class)
    public String register(RegisterException e) {
        return e.getMessage();
    }

    @ExceptionHandler(LoginException.class)
    public String login(LoginException e) {
        return e.getMessage();
    }

    @ExceptionHandler(SocialLoginException.class)
    public String socialLogin(SocialLoginException e) {
        return e.getMessage();
    }
}
